<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="../admin/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="../admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../admin/css/animate.css" rel="stylesheet">
    <link href="../admin/css/style.css?v=4.0.0" rel="stylesheet">

    <base target="_blank">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                        <div method="get" class="form-horizontal">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">用户名</label>

                                    <div class="col-sm-10">
                                        <input id='inputUserName' type="text" class="form-control" placeholder="用户名" value="">
                                    </div>
                                </div>
                            
                                <div class="form-group" >
                                    <label class="col-sm-2 control-label">密码</label>
                                    <div class="col-sm-10">
                                        <input id='inputPwd' type="text" class="form-control" placeholder="密码" value="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">邮箱</label>
                                    <div class="col-sm-10">
                                        <input id='inputEmail' type="text" class="form-control" placeholder="邮箱" value=""></input>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <a class="btn btn-primary" id="save" >保存内容</a>
                                        <a class="btn btn-white" >取消</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>              
    </div>

    <!-- 全局js -->
    <script src="../admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="../admin/js/bootstrap.min.js?v=3.3.5"></script>
    <!-- 自定义js -->
    <script src="../admin/js/content.js?v=1.0.0"></script>
    <script type="text/javascript">

    var BASE_URL = '../admin/js/plugins/webuploader';

    $('#save').click(function(){
        var userName=$('#inputUserName').val();
        var password=$('#inputPwd').val();
        var email=$('#inputEmail').val();

        $.ajax({
            type:'POST',
            url:'./userAdd',
            data:{userName:userName,password:password,email:email},
            dataType:'json',
            success:function(data){
                //当你在iframe页面关闭自身时
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭     
                // window.location.reload();//刷新当前页面.
            }               
        })
    })


    </script>
</body>

</html>